package edu.ccut.saturn.basecomponent.database.facade;

import java.sql.Connection;

import edu.ccut.saturn.basecomponent.database.ISaturnSQL;
import edu.ccut.saturn.basecomponent.database.SaturnSQLHandler;
import edu.ccut.saturn.basecomponent.database.impl.SaturnSQL;
import edu.ccut.saturn.basecomponent.database.util.SaturnDataUtil;

public class DeleteBySQL {
	public static int execute(String sql,Connection conn) throws Exception {
		SaturnSQL saturnSQL = new SaturnSQL();
		String dbType = SaturnDataUtil.getStandardDBTypeByConn(conn);
		saturnSQL.setDBtype(dbType);
		saturnSQL.setOperationType(ISaturnSQL.DELETE_OPERATION);
		saturnSQL.setSql(sql);
		int result = SaturnSQLHandler.executeUpdate(saturnSQL, conn);
		return result;
	}
}
